import decimal
from openpyxl.styles import fills,colors,NamedStyle,Font,Side,Border,PatternFill,Alignment,Protection
import sys
import mpmath as mp
import pandas as pd
import random
import numpy as np

for i in range(10):
    sum1=0
    sum2=decimal.Decimal(0)
    sum3=mp.mpf(0)
    list=[]
    
    for n in range(50):
        num=random.random()
        num=round(num*100,5)
        list.append(num)
        sum1=sum1+num
        sum2=decimal.Decimal(sum2)+decimal.Decimal(num)
        sum3=sum3+mp.mpf(num)
    # print("list:",list)
    print("direct:",sum1)
    print("decimal",sum2)
    print("mpmath",sum3)
    npd=np.array(list)
    print("numpy:",np.sum(npd))
    pdd=pd.Series(list)
    print("pandas:",pdd.sum())
